package com.timebank.score.controller;

import com.timebank.common.core.web.controller.BaseController;
import com.timebank.common.core.web.page.TableDataInfo;
import com.timebank.common.security.annotation.RequiresLogin;
import com.timebank.score.pojo.entity.LotteryLog;
import com.timebank.score.pojo.vo.LotteryLogVO;
import com.timebank.score.service.LotteryLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 抽奖记录 控制层
 * @author shiliuyinzhen
 */
@RestController
@RequestMapping("/lotteryLog")
@Api(tags = "抽奖记录相关接口")
public class LotteryLogController extends BaseController {

    @Resource
    private LotteryLogService lotteryLogService;

    /***
     * 查询抽奖记录
     * @param lotteryLog
     * @return
     */
    @RequiresLogin
    @GetMapping("/list")
    @ApiOperation("查询抽奖记录")
    public TableDataInfo getLotteryLogList(LotteryLog lotteryLog){
        startPage();
        List<LotteryLogVO> list= lotteryLogService.getLotteryLogList(lotteryLog);
        return getDataTable(list);
    }
}
